﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Data_Show.aspx.cs" Inherits="FPC.Offer.UI.SystemManage.Data_Show" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link href="../H-ui/static/h-ui/css/H-ui.min.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" />
    <link href="../H-ui/Lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/skin/default/skin.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/style.css" rel="stylesheet" />
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>详情</title>
</head>
<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 图片管理 <span class="c-gray en">&gt;</span> 图片列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div style="padding-left:600px" class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><input type="text" placeholder="添写字典" id="logmin" class="input-text Wdate" style="width:120px;"><a class="btn btn-primary radius" onclick="Dictionary_Add()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加</a></span> <span class="r">共有数据：<strong>54</strong> 条</span> </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort" id="Data_Show">
                <thead>
                    <tr class="text-c">             
                        <th>类型</th>
                        <th>操作</th>
                    </tr>
                  
                </thead>
                <tbody>                   
                </tbody>
            </table>
        </div>
    </div>

    <!--_footer 作为公共模版分离出去-->
    <script src="../H-ui/Lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="../H-ui/Lib/layer/2.4/layer.js"></script>
    <script src="../H-ui/static/h-ui/js/H-ui.js"></script>
    <script src="../H-ui/static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--/_footer 作为公共模版分离出去-->
    <!--请在下方写此页面业务相关的脚本-->
    <script src="../H-ui/Lib/My97DatePicker/4.8/WdatePicker.js"></script>
    <script src="../H-ui/Lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
    <script src="../H-ui/Lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript">
        //$('.table-sort').dataTable({
        //    "aaSorting": [[1, "desc"]],//默认第几个排序
        //    "bStateSave": true,//状态保存
        //    "aoColumnDefs": [
        //      //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
        //      { "orderable": false, "aTargets": [0, 8] }// 制定列不参与排序
        //    ]
        //});

        $(document).ready(function () {
            var url = location.search;
            var geturl = url.substring(url.indexOf("=") + 1);
            Data_Show(geturl);
        })
        //获取字典表该类型
        function Data_Show(s) {
            $.ajax({
                tyoe: 'post',
                url: '/GeneralProcessor/Systems/HandlerDictionary.ashx',
                data: {
                    Actioon:'<%=FPC.Offer.Common.EnumAction.Select.ToString() %>',
                    context:s,
                },
                success: function (s) {
                    var arr = JSON.parse(s);
                    var tr = new Array();
                    $(arr).each(function (i,obj) {
                        tr.push("  <tr class=\"text-c\">");
                        tr.push("    <td>" + obj.PlaceValue + "</td>");
                        tr.push("  <td class=\"td-manage\"><a style=\"text-decoration:none\" class=\"ml-5\" onclick=\"DictionaryDelete(" + obj.PlaceId + ")\" href=\"javascript:;\" title=\"删除\"><i class=\"Hui-iconfont\">&#xe6e2;</i></a></td>");
                        tr.push("  </tr>");                      
                    })
                    $("#Data_Show").append(tr.join())
                }
            })
        }

        /*添加字典*/
        function Dictionary_Add() {
            var url = location.search;
            var geturl = url.substring(url.indexOf("=") + 1);
            if ($("#logmin").val() == "") {
                alert("请添加内容"); return;
            }
            $.ajax({
                type: 'post',
                url: '/GeneralProcessor/Systems/HandlerDictionary.ashx',
                data: {
                    Actioon: '<%=FPC.Offer.Common.EnumAction.Add.ToString() %>',
                    DictionaryNameAdd: $("#logmin").val(),
                    GetUrl: geturl,
                },
                success: function (s) {
                    if (s) {
                        alert("添加成功"); location.reload();
                    }
                    else {
                        alert("添加失败，请重新添加");
                    }
                }
            })
        }

        /*删除字典*/
        function DictionaryDelete(id){
            if (confirm("确定要删除吗？") == true) {
                $.ajax({
                    type:'post',
                    url:'/GeneralProcessor/Systems/HandlerDictionary.ashx/',
                    data:{
                        Actioon:'<%=FPC.Offer.Common.EnumAction.Delete.ToString() %>',
                        GetId:id,
                    },
                    success:function(s){
                        if (parseInt(s) > 0) {
                            alert("删除字典成功"); location.reload();
                        }
                        else{
                            alert("删除字典失败");
                        }
                    }
                })
            }
           
        }   
    </script>
</body>
</html>